// This may look like C code, but it's really -*- C++ -*-
/*
 * Copyright (C) 2013 Emweb bv, Herent, Belgium.
 *
 * See the LICENSE file for terms of use.
 */

/* // minimal representation of a cube (not fit for textures)
const double cubeData[] = {
  0.0, 0.0, 0.0, //back-plane
  1.0, 0.0, 0.0,
  0.0, 1.0, 0.0,
  1.0, 1.0, 0.0,
  0.0, 0.0, 1.0, //front-plane
  1.0, 0.0, 1.0,
  0.0, 1.0, 1.0,
  1.0, 1.0, 1.0};

// indices for drawing triangles
const int cubeIndices[] = {
  0,1,2,    1,3,2, //back
  4,6,5,    5,6,7, //front
  0,4,5,    0,5,1, //bottom
  2,7,6,    2,3,7, //top
  0,6,4,    0,2,6, //left
  5,7,3,    3,1,5  //right
};
*/

namespace {

const float cubeData[] = {
// back plane
0, 0, 0, 
1, 0, 0, 
1, 1, 0, 
0, 1, 0, 
// left plane
0, 0, 1, 
0, 0, 0, 
0, 1, 0, 
0, 1, 1, 
// right plane
1, 0, 0, 
1, 0, 1, 
1, 1, 1, 
1, 1, 0, 
// top plane
0, 1, 0, 
1, 1, 0, 
1, 1, 1, 
0, 1, 1, 
// bottom plane
0, 0, 1, 
1, 0, 1, 
1, 0, 0, 
0, 0, 0, 
// front plane
0, 1, 1, 
1, 1, 1, 
1, 0, 1, 
0, 0, 1
};

// to determine which of three textures is used
const float cubePlaneNormals[] = {
  // back plane
  0, 0, 1,
  0, 0, 1,
  0, 0, 1,
  0, 0, 1,
  // left plane
  1, 0, 0,
  1, 0, 0,
  1, 0, 0,
  1, 0, 0,
  // right plane
  1, 0, 0,
  1, 0, 0,
  1, 0, 0,
  1, 0, 0,
  // top plane
  0, 1, 0,
  0, 1, 0,
  0, 1, 0,
  0, 1, 0,
  // bottom plane
  0, 1, 0,
  0, 1, 0,
  0, 1, 0,
  0, 1, 0,
  // front plane
  0, 0, 1,
  0, 0, 1,
  0, 0, 1,
  0, 0, 1
};

const int cubeIndices[] = {
0, 1, 2, 0, 2, 3, 
4, 5, 6, 4, 6, 7, 
8, 9, 10, 8, 10, 11, 
12, 13, 14, 12, 14, 15, 
16, 17, 18, 16, 18, 19, 
20, 21, 22, 20, 22, 23 
};

const int cubeLineIndices[] = {
  0, 1, 1, 2, 2, 3, 3, 0,
  4, 5, 5, 6, 6, 7, 7, 4,
  8, 9, 9, 10, 10, 11, 11, 8,
  12, 13, 13, 14, 14, 15, 15, 12,
  16, 17, 17, 18, 18, 19, 19, 16,
  20, 21, 21, 22, 22, 23, 23, 20

  // 0, 23, 3, 20, 2, 21, 1, 22,
  // 23, 22, 22, 21, 21, 20, 20, 23
};

const float cubeLineNormals[] = {
  // Back plane edges
  0, 0, -1,
  0, 0, -1,
  0, 0, -1,
  0, 0, -1,
  // left plane edges
  -1, 0, 0,
  -1, 0, 0,
  -1, 0, 0,
  -1, 0, 0,
  // right plane edges
  1, 0, 0,
  1, 0, 0,
  1, 0, 0,
  1, 0, 0,
  // top plane edges
  0, 1, 0,
  0, 1, 0,
  0, 1, 0,
  0, 1, 0,
  // bottom plane edges
  0, -1, 0,
  0, -1, 0,
  0, -1, 0,
  0, -1, 0,
  // front plane edges
  0, 0, 1,
  0, 0, 1,
  0, 0, 1,
  0, 0, 1

};

const float cubeTexCo[] = {0, 1, 1, 1, 1, 0, 0, 0, //back
                           1, 1, 0, 1, 0, 0, 1, 0, //left
                           0, 1, 1, 1, 1, 0, 0, 0, //right
                           0, 1, 1, 1, 1, 0, 0, 0, //top
                           0, 0, 1, 0, 1, 1, 0, 1, //bottom
                           0, 0, 1, 0, 1, 1, 0, 1  //front
};


}
